﻿
--离职申请
CREATE proc [dbo].[proc_Employee_DimissionApply]
(
	@Id int,
	@eid int,
	@reason text,
	@proposer nvarchar(50),
	@Kbn int,
	@LZTime VARCHAR(20),
	@DTemp int
)
as
begin
	if(@kbn=1)
		update employee_dimission set reason=@reason,proposer=@proposer,DTemp=@DTemp,appliontime=getdate(),LizhiDate = @LZTime where id=@id
	else
		insert into employee_dimission(eid,reason,proposer,dtemp,appliontime,LizhiDate) values(@eid,@reason,@proposer,@DTemp,getdate(),@LZTime)
	declare @TUserName nvarchar(50)
	Select @TUserName=UserName From Employee Where Id=@eid
	--2013-1-30 GSJ修改UserInRoles = ''
	--2016-2-1 清除数据范围权限
	Update aspnet_Users Set IsLockout=1,UserInRoles = '',Cid='' Where UserName=@TUserName
end
		
